//
//  LocationCalculateDistanceOptionsModel.m
//  o_amap
//
//  Created by Q神 on 2021/4/20.
//

#import "LocationCalculateDistanceOptionsModel.h"

@implementation LocationCalculateDistanceOptionsModel

- (CLLocationDistance)calculateLineDistance {
    if (self.startLat > 0 && self.startLng > 0 && self.endLat > 0 && self.endLng > 0) {
        /// 第一个坐标
         CLLocation *current = [[CLLocation alloc] initWithLatitude:self.startLat longitude:self.startLng];
        /// 第二个坐标
         CLLocation *before = [[CLLocation alloc] initWithLatitude:self.endLat longitude:self.endLng];
        /// 计算距离
        CLLocationDistance meters = [current distanceFromLocation:before];
        return meters;
    }
    return 0.0;
}

@end
